<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/6/5
 * Time: 16:02
 */

namespace common\validate;
use yii\base\Model;
use common\validate\BaseValidate;

class IDMustBePostiveInt extends BaseValidate
{
    public $id;
    /**
     * @inheritdoc
     */

    //验证规则
    public function rules()
    {
        return [
            // username and password are both required
            [['id'], 'required', 'message'=>'ID必须传值'],
            ['id','safe'],
            [['id'],'match','pattern'=>'/^[1-9]\d*/','message'=>'ID必须为正整数'],
        ];
    }



}